import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    cartList:[],
    show:false,
    goodsList:{
        
    },
    orderList:[]
   },
  getters: {},
  mutations: {
    addCart(state,data) {
      state.cartList.push(data)  
    },
    delCard(state,id) {
      state.cartList = state.cartList.filter(item => item.id != id)
    },
    isShow(state) {
      state.show = false
    },
    show(state) {
      state.show = true
    },
    payOrder(state,data) {
      state.orderList.push(data) 
    }
  },
  actions: {
  },
  modules: {},
});
